package chapter03;

public class Book {
    public static void main(String[] args) {
        Book b = new Book("西游记","吴承恩",500);
        b.info();
    }
    private String name;
    private String author;
    private int pages;
    public Book(String name, String author, int pages) {
        this.name = name;
        this.author = author;
        this.pages = pages;
    }
    public void info(){
        System.out.println("书的名字为："+this.name);
        System.out.println("书的作者为："+this.author);
        System.out.println("书的总页数："+this.pages);
    }
}
